
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
//unity的编辑器扩展
public class ShaderTemplateEditor:Editor
{
    [MenuItem("Assets/Create/Unlit URP Shader")]
    static void UnlitURPShader()
    {
        Debug.Log("创建Unlit URP Shader");
        return;
    
        //获取当前选择的路径
        string path = AssetDataBase.GetAssetPath(Selection.activeObject);
        //获取路径下的所有文件
        string templatePath = AssetDataBase.GUIDToAssetPath("d121571470245284146");
        //这个uuid在.meta文件下面
        string newPath = string.Format("{0}/New Unlit URP Shader.shader", path);
        AssetDataBase.CopyAsset(templatePath, newPath);
        AssetDataBase.ImportAsset(newPath);
    }

}